package org.spring;

import org.spring.bean.BeanDemo;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ClassPathXmlApplicationContextDemo {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-bean.xml");
        Object beanDemo = context.getBean("beanDemo");
        BeanDemo beanDemo1 = (BeanDemo) beanDemo;
        String showName = beanDemo1.showName();
        System.out.println(showName);
        context.close();
    }


}
